From 15f4fae9dc2fa675f62d7813de890e8c654435da Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Wed, 10 Aug 2005 09:50:05 +0000 Subject: [PATCH] dma_map_single can't sleep since it may be called with locks held, or interrupts off, etc. Thus it shouldn't make sleeping allocations. Signed-off-by: Chris Wright --- linux-2.6-xen-sparse/arch/xen/i386/kernel/pci-dma.c | 4 ++-- linux-2.6-xen-sparse/arch/xen/x86_64/kernel/pci-dma.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/linux-2.6-xen-sparse/arch/xen/i386/kernel/pci-dma.c b/linux-2.6-xen-sparse/arch/xen/i386/kernel/pci-dma.c index dae139a065..249507484f 100644 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/pci-dma.c +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/pci-dma.c @@ -182,8 +182,8 @@ dma_map_single(struct device *dev, void *ptr, size_t size, if ((((unsigned int)ptr & ~PAGE_MASK) + size) <= PAGE_SIZE) { dma = virt_to_bus(ptr); } else { - BUG_ON((bnc = dma_alloc_coherent(dev, size, &dma, 0)) == NULL); - BUG_ON((ent = kmalloc(sizeof(*ent), GFP_KERNEL)) == NULL); + BUG_ON((bnc = dma_alloc_coherent(dev, size, &dma, GFP_ATOMIC)) == NULL); + BUG_ON((ent = kmalloc(sizeof(*ent), GFP_ATOMIC)) == NULL); if (direction != DMA_FROM_DEVICE) memcpy(bnc, ptr, size); ent->dma = dma; diff --git a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/pci-dma.c b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/pci-dma.c index be30d893da..96b2ee64bc 100644 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/pci-dma.c +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/pci-dma.c @@ -234,8 +234,8 @@ dma_map_single(struct device *dev, void *ptr, size_t size, if (((((unsigned long)ptr) & ~PAGE_MASK) + size) <= PAGE_SIZE) { dma = virt_to_bus(ptr); } else { - BUG_ON((bnc = dma_alloc_coherent(dev, size, &dma, 0)) == NULL); - BUG_ON((ent = kmalloc(sizeof(*ent), GFP_KERNEL)) == NULL); + BUG_ON((bnc = dma_alloc_coherent(dev, size, &dma, GFP_ATOMIC)) == NULL); + BUG_ON((ent = kmalloc(sizeof(*ent), GFP_ATOMIC)) == NULL); if (direction != DMA_FROM_DEVICE) memcpy(bnc, ptr, size); ent->dma = dma; -- 2.30.2